package cn.com.yx.ms.domain.live;

/**
 * MQ队列配置实体
 * Created by zhul on 2017/3/10.
 */
public enum LiveConfigSourceType {

    Carousel("轮播", 0),
    Intercut("插播", 1),
    Live("直播", 2)
    ;

    private String name;
    private int index;

    private LiveConfigSourceType(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public static LiveConfigSourceType getEnumFromString(String string) {
        if (string != null) {
            try {
                return Enum.valueOf(LiveConfigSourceType.class, string.trim());
            } catch (IllegalArgumentException ex) {
            }
        }
        return null;
    }
}
